//
//  XFDAppDelegate.m
//  XFDCommon
//
//  Created by 北京国泰北斗科技有限公司 on 11/02/2017.
//  Copyright (c) 2017 北京国泰北斗科技有限公司. All rights reserved.
//

#import "XFDAppDelegate.h"
#import "XFDViewController.h"
#import <XFDCommon/HBTabBarController.h>
#import <XFDCommon/HBNavViewController.h>
#import <XFDCommon/HBCommon.h>

#import <XFDCommon/HBTabBarController.h>


@implementation XFDAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    
    self.window = [[UIWindow alloc]init];
    self.window.backgroundColor = [UIColor whiteColor];
    self.window.frame = [[UIScreen mainScreen] bounds];
    [self.window makeKeyWindow];
    [self.window makeKeyAndVisible];
    
    NSArray *array = @[[UIViewController new],[UIViewController new],[UIViewController new]];
    NSMutableArray *selImgs = [[NSMutableArray alloc] init];
    NSMutableArray *norImgs = [[NSMutableArray alloc] init];
    NSArray *imgs = @[@"menu_home",@"menu_phone",@"menu_my"];
    NSArray *titles = @[@"首页",@"通讯录",@"我的"];
    for (int i = 0; i < imgs.count; i++) {
        NSString *norName = [NSString stringWithFormat:@"%@_default",imgs[i]];
        NSString *selName = [NSString stringWithFormat:@"%@_selected",imgs[i]];
        UIImage *normal = [UIImage imageNamed:norName];
        UIImage *selected = [UIImage imageNamed:selName];
        [norImgs addObject:normal];
        [selImgs addObject:selected];
    }
    
    HBTabBarController *tab = [[HBTabBarController alloc] initWithControllers:array withSelectImages:selImgs withNormalImages:norImgs withTitles:titles];
    
//    XFDViewController *ctr = [[XFDViewController alloc]init];
//    HBNavViewController *nav = [[HBNavViewController alloc]initWithRootViewController:ctr];
    self.window.rootViewController = tab;
    return YES;
}
- (void)ineffectivenessToken{
    
}

- (void)tabBarSet{
    
    XFDViewController *ctr = [[XFDViewController alloc]init];
    XFDViewController *ctr1 = [[XFDViewController alloc]init];
    UIImage *image = [[UIImage alloc]init];
    HBTabBarController * tab = [[HBTabBarController alloc]initWithControllers:@[ctr,ctr1] withSelectImages:@[image,image] withNormalImages:@[image,image] withTitles:@[@"hah",@"yyy"]];
    self.window.rootViewController = tab;

}
- (void)applicationWillResignActive:(UIApplication *)application
{
    
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end
